package org.telegram.bot.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.telegram.bot.base.CustomSpringLongPollingBot;

import java.io.Serial;

/**
 * 机器人信息对象 bot_info
 *
 * @author wyx
 * @date 2023-05-29
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("bot_info")
public class BotInfo extends BaseEntity
{
    @Serial
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(value = "id")
    private String id;

    /** 机器人名称 */
    @Excel(name = "机器人名称")
    @TableField(value = "bot_name", condition = SqlCondition.LIKE)
    private String botName;
    
    /** 机器人名称 */
    @Excel(name = "APP")
    @TableField(value = "bot_app", condition = SqlCondition.LIKE)
    private String botApp;

    /** 机器人token */
    @Excel(name = "机器人token")
    private String token;

    /** 显示顺序 */
    @Excel(name = "显示顺序")
    private Integer orderNum;

    /** （0正常 1停用） */
    @Excel(name = "", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 创建者Id */
    @Excel(name = "创建者Id")
    @TableField(fill = FieldFill.INSERT)
    private Long createById;
    
    @JsonIgnore
    @TableField(exist = false)
    private CustomSpringLongPollingBot bot;
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("botName", getBotName())
            .append("token", getToken())
            .append("orderNum", getOrderNum())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createById", getCreateById())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
